package com.eh.factory.abstractFactory.store;

import com.eh.factory.abstractFactory.factory.PizzaIngredientFactory;
import com.eh.factory.abstractFactory.factory.impl.NYPizzaIngredientFactory;
import com.eh.factory.abstractFactory.pizza.NYCheesePizza;
import com.eh.factory.abstractFactory.pizza.NYClamPizza;
import com.eh.factory.abstractFactory.pizza.Pizza;

/**
 * Created by David on 2016/4/26.
 */
public class NYPizzaStore extends PizzaStore {
    private PizzaIngredientFactory nyPizzaIngredientFactory = new NYPizzaIngredientFactory();

    @Override
    protected Pizza create(String type) {
        Pizza pizza = null;
        if ("cheese".equals(type)) {
            pizza = new NYCheesePizza(nyPizzaIngredientFactory);
            pizza.setName("纽约奶酪披萨");
        } else if ("clam".equals(type)) {
            pizza = new NYClamPizza(nyPizzaIngredientFactory);
            pizza.setName("纽约捞蛤披萨");
        } else if ("veggie".equals(type)) {
        }
        return pizza;
    }
}
